package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by LN on 2017/7/11.16:02
 */
@Entity
@Table(name = "draw_log")
@DynamicInsert
public class DrawLogEntity extends BaseEntity {
    public enum DrawLogEntity_{
        openid
    }
    private String activityCode;
    private String prizeCode;
    private String prizeType;
    private String prizeName;
    private String participantName;
    private String openid;
    private String isWon;
    private String prizeNo;
    private String drawCode;
    private String isOver;
    private String hasDeliverInfo;
    private String drawNo;

    @Basic
    @Column(name = "activity_code")
    public String getActivityCode() {
        return activityCode;
    }

    public void setActivityCode(String activityCode) {
        this.activityCode = activityCode;
    }

    @Basic
    @Column(name = "prize_code")
    public String getPrizeCode() {
        return prizeCode;
    }

    public void setPrizeCode(String prizeCode) {
        this.prizeCode = prizeCode;
    }

    @Basic
    @Column(name = "prize_type")
    public String getPrizeType() {
        return prizeType;
    }

    public void setPrizeType(String prizeType) {
        this.prizeType = prizeType;
    }

    @Basic
    @Column(name = "prize_name")
    public String getPrizeName() {
        return prizeName;
    }

    public void setPrizeName(String prizeName) {
        this.prizeName = prizeName;
    }

    @Basic
    @Column(name = "participant_name")
    public String getParticipantName() {
        return participantName;
    }

    public void setParticipantName(String participantName) {
        this.participantName = participantName;
    }

    @Basic
    @Column(name = "openid")
    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    @Basic
    @Column(name = "is_won")
    public String getIsWon() {
        return isWon;
    }

    public void setIsWon(String isWon) {
        this.isWon = isWon;
    }
    @Basic
    @Column(name = "prize_no")
    public String getPrizeNo() {
        return prizeNo;
    }
    @Basic
    @Column(name = "draw_code")
    public String getDrawCode() {
        return drawCode;
    }
    @Basic
    @Column(name = "is_over")
    public String getIsOver() {
        return isOver;
    }

    public void setIsOver(String isOver) {
        this.isOver = isOver;
    }
    @Basic
    @Column(name = "has_deliver_info")
    public String getHasDeliverInfo() {
        return hasDeliverInfo;
    }

    public void setHasDeliverInfo(String hasDeliverInfo) {
        this.hasDeliverInfo = hasDeliverInfo;
    }

    public void setDrawCode(String drawCode) {
        this.drawCode = drawCode;
    }

    public void setPrizeNo(String prizeNo) {
        this.prizeNo = prizeNo;
    }
    @Basic
    @Column(name = "draw_no")
    public String getDrawNo() {
        return drawNo;
    }

    public void setDrawNo(String drawNo) {
        this.drawNo = drawNo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DrawLogEntity that = (DrawLogEntity) o;

        if (activityCode != null ? !activityCode.equals(that.activityCode) : that.activityCode != null) return false;
        if (prizeCode != null ? !prizeCode.equals(that.prizeCode) : that.prizeCode != null) return false;
        if (prizeType != null ? !prizeType.equals(that.prizeType) : that.prizeType != null) return false;
        if (prizeName != null ? !prizeName.equals(that.prizeName) : that.prizeName != null) return false;
        if (participantName != null ? !participantName.equals(that.participantName) : that.participantName != null)
            return false;
        if (openid != null ? !openid.equals(that.openid) : that.openid != null) return false;
        if (isWon != null ? !isWon.equals(that.isWon) : that.isWon != null) return false;
        if (prizeNo != null ? !prizeNo.equals(that.prizeNo) : that.prizeNo != null) return false;
        if (drawCode != null ? !drawCode.equals(that.drawCode) : that.drawCode != null) return false;
        if (isOver != null ? !isOver.equals(that.isOver) : that.isOver != null) return false;
        if (hasDeliverInfo != null ? !hasDeliverInfo.equals(that.hasDeliverInfo) : that.hasDeliverInfo != null)
            return false;
        return drawNo != null ? drawNo.equals(that.drawNo) : that.drawNo == null;
    }

    @Override
    public int hashCode() {
        int result = activityCode != null ? activityCode.hashCode() : 0;
        result = 31 * result + (prizeCode != null ? prizeCode.hashCode() : 0);
        result = 31 * result + (prizeType != null ? prizeType.hashCode() : 0);
        result = 31 * result + (prizeName != null ? prizeName.hashCode() : 0);
        result = 31 * result + (participantName != null ? participantName.hashCode() : 0);
        result = 31 * result + (openid != null ? openid.hashCode() : 0);
        result = 31 * result + (isWon != null ? isWon.hashCode() : 0);
        result = 31 * result + (prizeNo != null ? prizeNo.hashCode() : 0);
        result = 31 * result + (drawCode != null ? drawCode.hashCode() : 0);
        result = 31 * result + (isOver != null ? isOver.hashCode() : 0);
        result = 31 * result + (hasDeliverInfo != null ? hasDeliverInfo.hashCode() : 0);
        result = 31 * result + (drawNo != null ? drawNo.hashCode() : 0);
        return result;
    }
}
